<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEduLessonsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('edu_lessons', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('preview')->nullable()->comment('课程图片,可以为空');
            $table->tinyInteger('is_top')->default(0)->comment('是否置顶');
            $table->string('description')->nullable()->comment('课程描述');
            $table->unsignedInteger('video_num')->default(0)->comment('课程视频数');
            $table->unsignedInteger('user_id')->comment('课程作者');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('edu_lessons');
    }
}
